﻿
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Utils.Common;
using ZK.Entity.Config;

namespace ZK.BLL.Config
{

    [Serializable]
    public class CIJSystemConfig : ConfigBase
    {

        private static CIJSystemConfig systemConfig;
        public static CIJSystemConfig GetConfig()
        {
            if (systemConfig == null)
            {
                systemConfig = ConfigHelper.BackSerialize(new CIJSystemConfig());
                if (systemConfig == null)
                {
                    systemConfig = new CIJSystemConfig();
                }
                if (systemConfig.SystemInfoEntity == null) systemConfig.SystemInfoEntity=new CIJSystemInfoEntity();
                
            }
            return systemConfig;
        }

        [NonSerialized]
        public EventHandler SystemConfigEditHandler;

        //修改 
        public bool EditConfig()
        {
            try
            {
                ConfigHelper.Serialize(systemConfig);
                if (SystemConfigEditHandler != null)
                {
                    SystemConfigEditHandler(this, null);
                }
                return true;
            }
            catch
            {
                return false;
            }
        }
   

 
        public CIJSystemInfoEntity SystemInfoEntity { get; set; } = new CIJSystemInfoEntity();


 
    }

}
